//
//  NRWApplyMortgageHeaderView.m
//  Finance
//
//  Created by 邢毅 on 2018/7/31.
//  Copyright © 2018年 com.anpxd. All rights reserved.
//

#import "NRWApplyMortgageHeaderView.h"

@implementation NRWApplyMortgageHeaderView
{
	UILabel *_label;
}

- (instancetype)init
{
	self = [super init];
	if (self) {
		
		self.backgroundColor = getColor(@"e5e5e5");
		
		_label = [[UILabel alloc] init];
		_label.font = getThemeFont(13);
		_label.textColor = getColor(@"666666");
		[self addSubview:_label];
		
		[_label mas_makeConstraints:^(MASConstraintMaker *make) {
			make.left.equalTo(self.mas_left).offset(17);
			make.top.bottom.equalTo(self);
		}];
	}
	return self;
}

- (void)setDataSize:(NSString *)dataSize {
	
	_dataSize = dataSize;
	
	NSString *str = [NSString stringWithFormat:@"共有%@条信息", dataSize];
	
	NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:str];
	
	[attr addAttribute:NSForegroundColorAttributeName value:mainColor() range:NSMakeRange(2, dataSize.length)];
	
	_label.attributedText = attr;
}

@end
